package cn.wzy.controller;



import cn.wzy.pojo.Wxuser;
import cn.wzy.results.ResponseResult;
import cn.wzy.service.WxuserService;
import cn.wzy.vo.GoPageVo;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;

/**
 * (Wxuser)表控制层
 *
 * @author makejava
 * @since 2023-02-08 18:07:52
 */
@RestController
@RequestMapping("wxuser")

public class WxuserController{
    /**
     * 服务对象
     */
    @Resource
    private WxuserService wxuserService;
    
    /*
    * 查询分页
    * */
    @PostMapping("/page")

    public ResponseResult getWxuserPage(@RequestBody GoPageVo goPageVo){
        return wxuserService.getWxuserPage(goPageVo);
    }

    /*
    * 查询
    * */
    @GetMapping("/{id}")
    public ResponseResult getWxuser(@PathVariable("id") Long id){
        return wxuserService.getWxuser(id);
    }

    /*
    * 新增和修改
    * */
    @PostMapping
    public ResponseResult saveWxuser(@RequestBody Wxuser wxuser){
        return wxuserService.saveWxuser(wxuser);
    }

    /*
    * 删除
    * */
    @DeleteMapping("/{id}")
    public ResponseResult deleteWxuser(@PathVariable("id") Long id){
        return wxuserService.deleteWxuser(id);
    }


    /*
    * 批量删除
    * */
    @PatchMapping
    public ResponseResult deleteWxuserList(@RequestBody List<Long> ids){
        return wxuserService.deleteWxuserList(ids);
    }



}

